﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Threading.Tasks;
//using YmtAuth.Common.Utility;
//using YmtAuth.Domain.Shard;
//
//namespace YmtAuth.Domain.DomainService
//{
//    public class LoginKeyTypeService
//    {
//        public static LoginKeyType CheckLoginKeyType(string loginKey)
//        {
//            var rEmail = Regex.IsMatch(loginKey, @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", RegexOptions.IgnoreCase);
//            if (rEmail) return LoginKeyType.Email;
//
//            var rMobile = Regex.IsMatch(loginKey, @"^(13[0-9]|15[0|3|6|7|8|9]|18[8|9])\d{8}$", RegexOptions.IgnoreCase);
//            if (rMobile) return LoginKeyType.Mobile;
//
//            return LoginKeyType.LoginId;
//        }
//
//        public static string EncryptCookieToken(int userId, int userType, string logonTime)
//        {
//            //.ToString("yyyyMMddHHmmss")
//            string strRawToken = userId + "," + userType + "," + logonTime;
//            return new Encrypt().AesEncrypt(strRawToken, true);
//        }
//    }
//}
